//#include<iostream>
//#include<tuple>
//#define ROW 10
//#define COL 10
//using namespace std;
//struct Node {
//	int row;
//	int col;
//	int data;
//	Node* next;
//	Node* prev;
//};
//class myTable {
//private:
//	int length;
//	Node* head;
//	Node* tail;
//public:
//	myTable();
//	void init_myTable(const int arr[ROW][COL]);
//	~myTable();
//	bool is_emptyTable();
//	void pushTable(int row,int col,int data);
//	std::tuple<int, int, int> popTable();
//};
//void myTable::init_myTable(const int arr[ROW][COL]) {
//	for (int i = 0; i < COL; i++) {
//		for (int j = 0; j < ROW; j++) {
//			if (arr[i][j] != 0) {
//				this->pushTable(i, j, arr[i][j]);
//			}
//		}
//	}
//}
//std::tuple<int, int, int> myTable::popTable() {
//	Node* p = this->head->next;
//	if (!this->is_emptyTable()) {
//		std::tuple<int,int,int> res = std::make_tuple(p->row, p->col, p->data);
//		this->head->next = p->next;
//		this->length--; delete p;
//		return res;
//	}
//	return make_tuple(-1, -1, -1);
//}
//void myTable::pushTable(int row, int col, int data) {
//	this->tail->col = col, this->tail->row = row; this->tail->data = data;
//	Node* p = new Node; p->next = nullptr; p->prev = this->tail; this->tail->next = p;
//	this->tail = p; this->length++;
//}
//bool myTable::is_emptyTable() {
//	return this->length == 0;
//}
//myTable::myTable() {
//	this->length = 0;
//	this->head = new Node; this->tail = new Node;
//	this->head->next = this->tail; this->tail->prev = this->head;
//	this->head->prev = this->tail->next = nullptr;
//}
//myTable::~myTable() {
//	Node* temp = this->head;
//	while (this->head!=nullptr)
//	{
//		this->head = this->head->next;
//		delete temp;
//		temp = this->head;
//	}
//}
//void PrintArr(const int arr[ROW][COL]) {
//	for (int i = 0; i < COL; i++) {
//		for (int j = 0; j < ROW; j++) {
//			cout << arr[i][j] << "\t";
//		}
//		cout << endl;
//	}
//}
//void ChangeArr(int arr[COL][ROW],myTable& matrix) {
//	while (!matrix.is_emptyTable())
//	{
//		std::tuple<int, int, int>res = matrix.popTable();
//		int row = get<1>(res); int col = get<0>(res); int data = get<2>(res);
//		arr[row][col] = data;
//	}
//}
//void test() {
//	int arr1[ROW][COL] = { 0 }; int arr2[COL][ROW] = { 0 };
//	arr1[2][4] = 598; arr1[4][5] = 239; arr1[7][3] = -397; arr1[9][9] = 438;
//	PrintArr(arr1);
//	myTable matrix;
//	matrix.init_myTable(arr1);
//	ChangeArr(arr2, matrix);
//	cout << endl;
//	PrintArr(arr2);
//}
//int main()
//{
//	test();
//	return 0;
//}